class Stutent:
    best_stu = None
    def __init__(self,name,math,chi,eng):
        self.name = name
        self.mscore = math
        self.cscore = chi
        self.escore = eng
        self.sum = math + chi + eng
        #更新类变量
        if Stutent.best_stu is None or self.sum > Stutent.best_stu.sum:
            Stutent.best_stu = self
    def getSum(self):
        return self.sum
    @classmethod
    def getBest(cls):
        return Stutent.best_stu

#按行读取成绩
line = input().split()
lines = [line]
for i in range(3):
    line = input().split()
    lines.append(line)

#生成对象，并利用更新机制得到成绩最好的学生
stus = []
for i in range(len(line)):
    # print(lines[0][i],lines[1][i],lines[2][i],lines[3][i])
    stus.append(Stutent(lines[0][i],int(lines[1][i]),int(lines[2][i]),int(lines[3][i])))
top1 = Stutent.getBest()
print(top1.name,top1.mscore,top1.cscore,top1.escore)


# line = input().split()
# lines = [line]
# for i in range(3):
#     line = input().split()
#     for i in range(len(line)):
#         line[i] = int(line[i])
#     lines.append(line)
# print(lines)